package com.ruitu.mall_98_2.mine;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.beanu.arad.base.my_base.MyBaseActivity;
import com.beanu.arad.utils.AppUtils;
import com.beanu.arad.widget.progressactivity.ProgressLayout;
import com.ruitu.mall_98_2.R;
import com.ruitu.router_module.A_Rutils;

public class AboutActivity extends MyBaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_about;
    }

    @Override
    protected ProgressLayout findProgressLayout() {
        return null;
    }

    @Override
    protected void initViews() {
        super.initViews();
        setHeadTitle("关于我们");

        TextView tv_version = findViewById(R.id.tv_version);
        tv_version.setText("当前版本: V" + AppUtils.getAppVersionName());

        TextView tv_service = findViewById(R.id.tv_service);
        tv_service.setOnClickListener(this);
        TextView tv_privacy = findViewById(R.id.tv_privacy);
        tv_privacy.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        Bundle bundle = new Bundle();
        if (v.getId() == R.id.tv_service) {
            bundle.putString("type", "1");
            try {
                A_Rutils.startActivity(this, "com.ruitu.mall_98.activity.ServiceAndPrivacyActivity", bundle);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        }
        if (v.getId() == R.id.tv_privacy) {
            bundle.putString("type", "2");
            try {
                A_Rutils.startActivity(this, "com.ruitu.mall_98.activity.ServiceAndPrivacyActivity", bundle);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        }
    }
}
